<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/classes/CommonHelper.class.jsp"%>
<%@ include file="/classes/DBHelper.class.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%

	String loginId=(String)(session.getAttribute("loginId")==null?"":session.getAttribute("loginId"));
	if(nullOrEmpty(loginId)){
		out.print("<script>alert(\"请登陆后操作！\");</script>");
		out.print("<script>window.location.href = 'http://htgl.cnsn.gov.cn/cas/login';</script>");
		return;
	}
	
	//获取部门ID
	String dept_code = "";
	String dept_name = "";
	String sqlDept = "select t2.* from cms_user t1,cms_department t2 where t1.dept_id = t2.dept_id and login_id = ?";
	Map<String,Object> user = getObject(sqlDept,new Object[]{loginId});
	if(null!=user)
		{dept_code = (String)user.get("code_name");
         dept_name= (String)user.get("name");
        }

	String hzd = getParameter(request,"hzd");
	String status = getParameter(request,"status");
	String sql = "select * from APP_SUGGESTION_BOX where bm_id = ?";
	List<Object> params = new ArrayList<Object>();
	params.add(dept_code);
	if(!nullOrEmpty(hzd)){
		sql += " and hzd = ?";
		params.add(hzd);
	}
	
	if(!nullOrEmpty(status)){
		if("1".equals(status)){
			sql += " and hftime is not null";	
		}else{
			sql += " and hftime is null";
		}
	}
	
	sql +=" order by addtime desc";
	
	int currentPage = 1; 
	if(!nullOrEmpty(getParameter(request,"currentPage"))){
		currentPage = Integer.parseInt(getParameter(request,"currentPage"));
	}
	
	List<Map<String,Object>> list = queryForListPage(sql,params,currentPage,15);
	int total = queryForPageCount(sql,params);
	
	Map<String,Integer> pageMap = new HashMap<String,Integer>();
	pageMap.put("currentPage",currentPage);
	pageMap.put("total",total);
	request.setAttribute("page",pageMap);

%>

<title></title>
</head>
<style type="text/css">
	* {
	padding:0;
	margin:0 auto;
} /* IE8*/
*+html * {
	padding:0;
	margin:0;
}
* {
	margin:0;
	padding:0;
}
body {
	margin:0px;
	font-size:12px;
	font-family:"宋体";
	color:#333;
	background:url(../images/bg02.jpg);
}
div {
	font-size:12px;
	text-align:left;
}
a {
	color:#333;
	text-decoration:none;
}
a:hover {
	color:#c00;
	text-decoration:none;
}
ul, li {
	padding:0px;
	margin:0px;
	list-style-type:none;
}
img {
	border:none;
}
div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, blockquote {
	padding:0;
	margin:0;
}
table, td, tr, th {
	font-size:12px;
}
ul, li {
	margin:0px;
	padding:0px;
	list-style-type:none;
}
.clear {
	clear:both;
}
.transparent {
	background:transparent;
}
.left {
	float:left;
}
.right {
	float:right;
}

.white_font{font-size:14px; color:#fff;}
.table_td td{padding:4px; line-height:1.5;}
.div_cen{text-align:center; padding:5px 0; background:#87B1E3;}
	.jysz_nav_left{background:url(images/nav_left.jpg) no-repeat bottom left #EEF5FB; height:24px; line-height:24px; text-indent:10px; font-size:12px; color:#0065AB; font-weight:bold;border:1px solid #AACADF;position:relative; overflow:hidden}
	.jysz_nav_left a{color:#0065AB; font-weight:bold;}
	.jysz_nav222{ text-indent:34px; background:url(images/navfsdsds.jpg) no-repeat 15px 50%;line-height:24px; height:24px; font-size:12px; color:#333; font-family:"微软雅黑"; border:1px solid #AACADF; border-top:none; border-bottom:none;}
	.jysz_nav222 a{ font-size:12px;color:#333; font-family:"微软雅黑"; text-decoration:none;}
	.jysz_nav222 a:hover{text-decoration:none;color:#333;}
	
	
	.jysz_nav222ss{ text-indent:64px; background:url(images/navfsdsds.jpg) no-repeat 45px 50%;line-height:24px; height:24px; font-size:12px; color:#333; font-family:"微软雅黑"; border:1px solid #AACADF; border-top:none; border-bottom:none;}
	.jysz_nav222ss a{ font-size:12px;color:#333; font-family:"微软雅黑";}
	.jysz_nav222ss a:hover{text-decoration:none;color:#c30;}
	</style>
<body>
<form action="xxgkyjx_list.jsp?r=<%=new Date().getTime() %>" method="post" name="xxgkyjx_listForm">
<div style="height:20px; font-size:1px;"></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="10">&nbsp;</td>
    <td valign="top">
	<table border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC" style="BORDER-COLLAPSE: collapse" width="100%" class="table_td">
		<tr height="23" bgcolor="#5D8DD7" class="rowoutlight">
			<td><span style="color:#FFF">序号</span></td><td><span style="color:#FFF">标题</span></td><td><span style="color:#FFF">姓名</span></td><td><span style="color:#FFF">联系电话</span></td><td><span style="color:#FFF">留言时间</span></td><td><span style="color:#FFF">状态</span></td><td><span style="color:#FFF">部门</span></td>
		</tr>
		<c:forEach items="<%=list %>" var="info" varStatus="i">
		
		<tr class="aaaf">
			<td height="28">${i.index+1 }</td>
			<td><a href="xxgkyjx_hf.jsp?hzd=${info.hzd }&r=<%=new Date().getTime()%>">
			<c:if test="${empty info.title }">无标题</c:if>
			${info.title }</a> </td>
			<td>${info.xingm }</td><td>${info.lxdh }</td><td>
			<c:if test="${null!=info.addtime }">
			<fmt:formatDate value="${info.addtime }" pattern="yyyy-MM-dd"/>
			</c:if>
			</td>
			<td>
			<c:if test="${null!=info.content_hf }">已回复</c:if>
			<c:if test="${empty info.content_hf }">未回复</c:if>
			</td>
			<td><%=dept_name%></td>
		</tr>
		</c:forEach>
		<tr class="aaaf" height="28">
			<td colspan="7">
			<jsp:include page="/common/page.jsp" >
		    		<jsp:param value="${page.currentPage }" name="currentPage"/>
					<jsp:param value="${page.total }" name="totalRecord"/>
					<jsp:param value="15" name="pageSize"/>
					<jsp:param value="xxgkyjx_listForm" name="formName"/>
					<jsp:param value="<%=new Date().getTime() %>" name="r"/>
		    	</jsp:include>
			</td>
		</tr>
	</table>
    </td>
  </tr>
</table>
	</form>
</body>
</html>